package disjunction.core.state
{
	import flash.events.Event;
	
	/**
	 * A state in a FSM, which may receive configuration data.
	 *
	 * @author Nick Wiggill
	 */
	
	public class StateChangeEvent extends Event
	{
		public static const CHANGE:String = "Change";
		public var toStateId:String;
		public var fromStateId:String;
		public var data:Object;
		
		public function StateChangeEvent(type:String, toStateId:String, fromStateId:String, data:Object, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
			this.toStateId = toStateId;
			this.fromStateId = fromStateId;
			this.data = data;
		}
		
		public override function clone():Event
		{
			return new StateChangeEvent(type, toStateId, fromStateId, data, bubbles, cancelable);
		}
	}
}